import java.io.*;

public class Etlhttp {

    public static void main(String[] args) {
        File file = new File("C:\\Users\\ASUS\\Desktop\\慧科项目\\eks-backend\\eks-backend\\ai\\configmap\\auto-summary-api.yaml"); // 替换为实际的文件路径

        String wordToSearch = "http://"; // 替换为需要搜索的单词

        try {
            FileInputStream fis = new FileInputStream(file);
            InputStreamReader isr = new InputStreamReader(fis);
            BufferedReader br = new BufferedReader(isr);

            String line;
            boolean wordFound = false;

            while ((line = br.readLine()) != null) {
                if (line.contains(wordToSearch)) {
                    wordFound = true;
                    break;
                }
            }

            br.close();

            if (wordFound) {
                System.out.println("文件中包含单词 " + wordToSearch);
            } else {
                System.out.println("文件中不包含单词 " + wordToSearch);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
